First, HAProxy
1.haproxy Introduction
HAProxy is a free, fast, and reliable solution that provides high availability, load balancing, and proxy software based on TCP (layer fourth) and HTTP (layer seventh) applications that support virtual hosting.
Haproxy is a free and open source software written in C lan
Description
Operating system: CentOS 5.X 64-bit
Web server: 192.168.21.127, 192.168.21.128
Sites: Bbs.111cn.net and Sns.111cn.net deployed on two Web servers
To achieve the purpose:
Add two servers (main main mode) to achieve Web server load balancing through haproxy+keep
haproxy+keepalived Build WEB Cluster We have learned two Web cluster software nginx and LVS, they have their own characteristics, this chapter will introduce another cluster software haproxy, we will be on its scheduling algorithm, cluster environment, as well as the configuration of the cluster to explain. Haporxy is
! Configuration File for KeepalivedGlobal_defs {Notification_email {//notification e-mail}Vrrp_instance vi_1 {//VRRP hot spareState master backup/hot standby status Master, backup supplementedNopreempt//No preemption, Master does not transfer after recoveryinterface eth0//physical Interface hosting VIPVIRTUAL_ROUTER_ID 51//Virtual route number, one per groupPriority 55/priorities, bigger, higher priorityAdvert_int 1//Heartbeat frequency, unit secondsA
theory, it is best not to, but the actual light by keepalived is not to be done.Configuration:1, install the keepalived on two servers respectively[Email protected] ~]# yum-y install keepalived2, Configuration keepalived[[emailprotected] ~]# vim/etc/keepalived/keepalived.conf! Configuration File for Keepalivedglobal_defs {notification_email {[emailprotected] config service state change send mail to which address } Notification_email_from [emailprotected] smtp_server 127.0.0.1 to which SMTP
1. Preface
The previous section implemented a technical solution based on LVS (DR) + keepalived cluster. However, in terms of usage and maintenance, it was found that it is more difficult to maintain and implement than the haproxy + keepalived technical solution, the haproxy + keepalived cluster for Web applications is sufficient. Therefore, we recommend the
Overview:Haproxy is a cluster scheduling tool that provides high availability, load balancing, and proxy software based on TCP (layer fourth) and HTTP (layer seventh) applications, supporting virtual hosting, which is a free, fast, and reliable solution. Haproxy is especially useful for Web sites that are heavily loaded, and often require session-hold or seven-tier processing.
Haproxy is currently a popular cluster scheduling tool, similar cluster scheduling tool has many, such as LVS and Nginx, compared to the best performance of LVS, but the construction of relatively complex, Nginx upstream module support cluster function, but the cluster node health Check function is not strong, Performance is not hapr oxy good. The official website of Haproxy is http://
Haproxy provides high availability, Load Balancing and proxies based on TCP and HTTP applications that support Virtual Host , it is a free, fast and reliable solution. Haproxy is especially useful for Web sites that are heavily loaded, and often require session-hold or seven-tier processing. Experiment (I.)Experimental purpose: Using
2 Maxconn Listen Statspage # define the interface of the monitoring management interface bind *:8888 # define the access page Port stats Enable # Enables the Admin interface stats Hide-versi On # hidden version Stats uri/admin?stats # access path stats auth Admin:centos # Access requires authentication login Stats Admin If TRUE # if login The online server can b
Scope:linkUp broadcast RUNNING multicast mtu:1500 metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:6 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 b) TX bytes:468 (468.0 b)[Email protected] ~]#
Set up the relevant configuration on Node1 and Node2, select the same communication channel of eth1 on the VMnet2 and Haproxy on the virtual machine, configure the IP address and default gateway
General Planning:
Host
Ip
Describe
Vip
192.168.0.222
Provide high-availability IP externally
Haproxy+keepalived (Node1)
192.168.0.111
Haproxy for the back-end two Web services to do static and dynamic separation, keepalived for haproxy to do high a
of the featureNext we test the characteristics of the haproxy, in the Haproxy configuration file There is the following paragraphListen stats bind:10086 stats enable stats uri/admin?stats Stats Auth admin:admin stats ad Min if TRUEThis configuration allows us to view and modify the Haproxy statistics interface in the
communication channel of eth1 on the VMnet2 and Haproxy on the virtual machine, configure the IP address and default gateway interface, and then provide different pages for testing;
[[emailprotected] ~]# I Fconfig eth0 192.168.27.18/24 up [[emailprotected] ~]#route add defaulte GW 192.168.27.18 # The gateway points to the eth1 address of the Haproxy
haproxy, in the Haproxy configuration file There is the following paragraphListen stats bind:10086 stats enable stats uri/admin?stats Stats Auth admin:admin stats ad Min if TRUEThis configuration allows us to view and modify the Haproxy statistics interface in the browser to enable the relevant parameters, enter Http:
HAProxy provides high availability, load balancing, and proxies based on TCP and HTTP applications, supporting virtual hosting, which is a free, fast, and reliable solution.Haproxy is especially useful for Web sites that are heavily loaded, and often require session-hold or seven-tier processing. The haproxy runs on the current hardware and can support tens of th
Brief introductionHaproxy is a free and open source software written in the C language that provides high availability, load balancing, and application proxies based on TCP and HTTP. Haproxy is especially useful for Web sites that are heavily loaded, and often require session-hold or seven-tier processing. The haproxy runs on the current hardware and can support
Haproxy Proxy to build a highly available Web clusterStatus code for HTTP protocol response:200:ok301: Redirect404:not found403:forbidden501:internal ErrorHAProxy:1, it's working principle is proxy agent. After the client sends the request to Haproxy, Haproxy sends the request to the
Haproxy is a cluster scheduling tool that provides high availability, load balancing, and proxy software based on TCP (layer fourth) and HTTP (layer seventh) applications, supporting virtual hosting, which is a free, fast, and reliable solution. Haproxy is especially useful for Web sites that are heavily loaded, and often require session-hold or seven-tier proces
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.